#include <QtGui/QApplication>
#include <QTranslator> // include QTranslator
#include <QLocale> // include QLocale

#include <QDebug>
#include "qmlapplicationviewer.h"

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QLocale locale; // A locale instance

    // Load .qm translation file of the language currently set in system settings
    QTranslator translator;
    //translator.load(QString("i18n/translation_",":/") + locale.language());
    translator.load("i18n/translation_ar",":/"); // or this way. Note without .qm extension

    // You could also load it that way
    // Install the translator
    app.installTranslator(&translator);

    // Continue launching the app
    QmlApplicationViewer viewer;
    viewer.setMainQmlFile(QLatin1String("qml/LocalizationDemo/main.qml"));
    viewer.showExpanded();

    return app.exec();
}
